<!DOCTYPE html>
<html>
<head>
    <meta name="layout" content="main"/>
    <g:set var="entityName"
           value="${message(code: 'workflowInstanceNotification.label', default: 'WorkflowInstanceNotification')}"/>
    <title>新增工作流-事件</title>
</head>

<body>

<div class="small-header">
    <div class="hpanel">
        <div class="panel-body">
            <div id="hbreadcrumb" class="pull-right">
                <ol class="hbreadcrumb breadcrumb">
                    <li>CINDATA PLS</li>
                    <li class="active">
                        <span>新增工作流-事件</span>
                    </li>
                </ol>
            </div>

            <h2 class="font-light m-b-xs">
                新增事件
            </h2>
        </div>
    </div>
</div>

<div class="content animate-panel">
    <div class="row">
        <div class="hpanel hblue">
            <div class="panel-heading">
                新增工作流-事件
            </div>

            <div class="panel-body">
                <g:form action="save" class="form-horizontal flowForm">
                    <g:if test="${flash.message}">
                        <div class="message" role="status">${flash.message}</div>
                    </g:if>
                    <g:hasErrors bean="${this.workflowInstanceNotification}">
                        <ul class="errors" role="alert">
                            <g:eachError bean="${this.workflowInstanceNotification}" var="error">
                                <li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message
                                        error="${error}"/></li>
                            </g:eachError>
                        </ul>
                    </g:hasErrors>

                    <g:textField class="form-control hidden"  type="text" name="targetUri" id="targetUri" value="${params.targetUri}"/>
                    <g:textField  class="form-control hidden"  name="stage.id" id="stage" value="${params?.workflowInstanceStage}" />

                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <label class="col-md-4 control-label">用户</label>

                        <div class="col-md-4">
                            <g:select class="form-control" name="user.id" id="user" value="${this.workflowInstanceNotification?.user?.id}" from="${com.cindata.User.list()}" optionKey="id" optionValue="fullName" noSelection="['': '请选择用户']"></g:select>
                        </div>
                    </div>

                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <label class="col-md-4 control-label">短信模板</label>

                        <div class="col-md-4">
                            <g:select class="form-control" name="messageTemplate.id" id="messageTemplate" value="${this.workflowInstanceNotification?.messageTemplate?.id}" from="${com.cindata.MessageTemplate.list()}" optionKey="id" optionValue="name" noSelection="['': '请选择短信模板']"></g:select>
                        </div>
                    </div>

                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <label class="col-md-4 control-label">是否发送主管</label>

                        <div class="col-md-4">
                            <g:select class="form-control" name="toManager" id="toManager" from="${[[name:'是',value:true],[name:'否',value:false]]}" optionValue="name" optionKey="value" value="${this.workflowInstanceNotification?.toManager}"/>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-md-4 control-label">手机号</label>
                        <div class="col-md-4">
                            <g:textField name="cellphone" value="${this.workflowInstanceNotification?.cellphone}" class="form-control"/>
                        </div>
                    </div>
                    <div class="hr-line-dashed"></div>

                    <div class="form-group">
                        <div class="col-md-3 col-md-offset-5">
                            <button class="submitBtn btn btn-info" type="submit">保存</button>
                        </div>
                    </div>
                </g:form>
            </div>
        </div>
    </div>
</div>

</body>
</html>
